package com.yesallchina.wxapp.officialaccount.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 *  提供额外的处理
 *
 *  例如：微信公众号的配置数据通过数据库加载而不是application.properties文件
 *
 */
@ConfigurationProperties(prefix = "wxapp.officialaccount.spi", ignoreUnknownFields = true)
public class WxOfficialAccountSpiProperties {
    // 加载微信公众号基础配置
    private String commonConfigLoaderName;

    // accessToken的存储和获取
    private String accessTokenCacheName;
    // 是否在应用启动的时候获取AccessToken
    // 0否  1是
    private int loadTokenStartup = 0;

    // 网页授权Ticket存储
    private String jsapiTicketCacheName;
    private String cardapiTicketCacheName;
    // 是否在应用启动的时候获取网页ticket
    // 0否 1是
    private int loadWebpageTicket = 0;

    // 公众号消息处理
    private String messageHandlerName;

    // 微信支付回调
    private String payCallbackHandlerName;

    // 微信退款回调
    private String refundCallbackHandlerName;

    public String getPayCallbackHandlerName() {
        return payCallbackHandlerName;
    }

    public void setPayCallbackHandlerName(String payCallbackHandlerName) {
        this.payCallbackHandlerName = payCallbackHandlerName;
    }

    public String getCardapiTicketCacheName() {
        return cardapiTicketCacheName;
    }

    public void setCardapiTicketCacheName(String cardapiTicketCacheName) {
        this.cardapiTicketCacheName = cardapiTicketCacheName;
    }

    public String getJsapiTicketCacheName() {
        return jsapiTicketCacheName;
    }

    public void setJsapiTicketCacheName(String jsapiTicketCacheName) {
        this.jsapiTicketCacheName = jsapiTicketCacheName;
    }

    public String getCommonConfigLoaderName() {
        return commonConfigLoaderName;
    }

    public void setCommonConfigLoaderName(String commonConfigLoaderName) {
        this.commonConfigLoaderName = commonConfigLoaderName;
    }

    public String getAccessTokenCacheName() {
        return accessTokenCacheName;
    }

    public void setAccessTokenCacheName(String accessTokenCacheName) {
        this.accessTokenCacheName = accessTokenCacheName;
    }

    public String getMessageHandlerName() {
        return messageHandlerName;
    }

    public void setMessageHandlerName(String messageHandlerName) {
        this.messageHandlerName = messageHandlerName;
    }

    public int getLoadTokenStartup() {
        return loadTokenStartup;
    }

    public void setLoadTokenStartup(int loadTokenStartup) {
        this.loadTokenStartup = loadTokenStartup;
    }

    public int getLoadWebpageTicket() {
        return loadWebpageTicket;
    }

    public void setLoadWebpageTicket(int loadWebpageTicket) {
        this.loadWebpageTicket = loadWebpageTicket;
    }

    public String getRefundCallbackHandlerName() {
        return refundCallbackHandlerName;
    }

    public void setRefundCallbackHandlerName(String refundCallbackHandlerName) {
        this.refundCallbackHandlerName = refundCallbackHandlerName;
    }
}
